The Domain Name System (DNS) is a distributed hierarchical system that resolves domain names into IP addresses. 🌐
Humans remember:
google.com
Machines understand:
142.250.190.14
DNS translates names into numeric IP addresses so computers can communicate.
Suppose you search for:
google.com
Here’s what happens step by step:
Flow:
Browser → OS Stub Resolver
The stub resolver is part of the operating system, not the browser.
The stub resolver checks locally in this order:
C:\Windows\System32\drivers\etc\hosts/etc/hostsIf the IP is found → resolution stops.
If not found → query is forwarded to a Recursive DNS Server, such as:
8.8.8.8)1.1.1.1)The first external DNS server contacted is called the:
Recursive Resolver
Its job is to fully resolve the domain.
It first checks:
If found → returns IP.
If not → it begins querying the DNS hierarchy.
There are 13 named root server systems (A–M).
They are globally distributed using Anycast and coordinated by:
When asked:
“Where is
google.com?”
The root server replies:
“I don’t know
google.com, but here are the name servers for.com.”
It returns NS (Name Server) records for the .com TLD.
TLD = Top Level Domain
Examples:
.com.org.pk.ioIt is the last portion of a domain name.
You can manually query a root server:
nslookup -type=NS com. m.root-servers.net
This asks:
“Who manages the
.comTLD?”
The root server returns TLD name servers like:
a.gtld-servers.net
b.gtld-servers.net
...
The recursive resolver contacts one of the .com TLD servers and asks:
“Who is authoritative for
google.com?”
The TLD server returns the Authoritative Name Servers for that domain.
Example:
nslookup -type=NS chatgpt.com d.gtld-servers.net
This shows which servers manage chatgpt.com.
Now the recursive resolver asks one of the authoritative servers:
“What is the A record (IP address) for
google.com?”
The authoritative server replies with the final IP address.
When the recursive resolver receives the IP:
Note: DNS TTL is different from packet TTL.
Then:
Future lookups are faster until TTL expires.
google.com🎥 Reference Video: